﻿public namespace System.HTML
{
	@Native("window")
	public Window window { get; }

	@Native("document")
	public Document document { get; }
	
	@Native
	public abstract sealed class Window
	{
		@HTMLEvent("resize")
		public event Event Resize;
		@HTMLProperty("innerWidth")
		public num InnerWidth { get; }
		@HTMLProperty("innerHeight")
		public num InnerHeight { get; }
	}

	@Native
	public abstract sealed class Document
	{
		@NativeMember("getElementById")
		public Node GetElementById( string name );
	}
	
	@Native
	public abstract sealed class Event
	{
	}

	public enum CSSPosition : string
	{
		relative = "relative",
		absolute = "absolute"
	}

	public enum CSSFloat : string
	{
		none = "none",
		left = "left",
		right = "right",
		inherit = "inherit"
	}
	
	@Native
	public abstract sealed class Style
	{
		@HTMLProperty("color")
		public string color { get; set; }
		@HTMLProperty("backgroundColor")
		public string backgroundColor { get; set; }
		@HTMLProperty("left")
		public string left { get; set; }
		@HTMLProperty("top")	
		public string top { get; set; }
		@HTMLProperty("width")
		public string width { get; set; }
		@HTMLProperty("height")	
		public string height { get; set; }
		@HTMLProperty("margin")	
		public string margin { get; set; }
		@HTMLProperty("position")
		public CSSPosition position { get; set; }
		@HTMLProperty("cssFloat")
		public CSSFloat float { get; set; }
	}

	@Native
	public abstract class Node
	{
		@NativeMember("appendChild")
		public void AppendChild(Node node);
		@NativeMember("removeChild")
		public void RemoveChild(Node node);
		@NativeMember("style")
		public Style style { get; }
		@HTMLEvent("click")
		public event void click;
		@HTMLProperty("offsetWidth")
		public num offsetWidth { get; }
		@HTMLProperty("offsetHeight")
		public num offsetHeight { get; }
		@HTMLProperty("nodeValue")
		public string nodeValue { get; set; }
	}
		
	@Native("document.createElement")
	public Node CreateElement(string tag);
	@Native("document.createTextNode")
	public Node CreateTextNode(string text);

	@HTMLClass
	public abstract sealed class h1 : Node
	{
	}

	@HTMLClass
	public abstract sealed class h2 : Node
	{
	}
		
	@HTMLClass
	public abstract sealed class div : Node
	{
	}
	
	@HTMLClass
	public abstract sealed class span : Node
	{
	}

	@HTMLClass
	public abstract sealed class input : Node
	{
		@HTMLProperty("type")
		public string type { get; set; }
		@HTMLProperty("value")
		public string value { get; set; }
	}	
}
